package common;

import jdd.bdd.BDD;

public class BDDEngine {
    public final static int BDDFalse = 0;
    public final static int BDDTrue = 1;

    final static int protocolBits = 8;
    final static int portBits = 16;
    final static int ipBits = 32;

    final static int srcIPStartIndex = 0;
    final static int dstIPStartIndex = srcIPStartIndex + ipBits;
    final static int srcPortStartIndex = dstIPStartIndex + ipBits;
    final static int dstPortStartIndex = srcPortStartIndex + portBits;
    final static int protocolStartIndex = dstPortStartIndex + portBits;

    final static int size = protocolStartIndex + protocolBits;

    BDD bdd;

    int[] vars;

    public BDDEngine(){
        bdd = new BDD(10000, 10000);
        vars = new int[size];
        for(int i=0;i<size;i++){
            vars[i] = bdd.createVar();
        }
    }

    public int encodeDstIPPrefix(long ipAddress, int prefixLength){
        return 1;
    }

    public BDD getBDD(){
        return bdd;
    }
}
